<include file="Public/common" />
<block>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        .col-xs-3{margin-top:5px;}
        th{text-align: center;}
        .form-group{margin-left:20px;}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1>首页 &gt;商家管理 > 景区供应商</h1></div>
    <form action="" method="get" class="form-inline" >
        <div class="form-group">
            <label for="" >供应商编号:</label>
            <input type="text" class="form-input" name="supplier_sn" placeholder="请输供应商编号" value="{$post.supplier_sn}" />
        </div>
        <div class="form-group">
            <label for="" >供应商名称:</label>
            <input type="text" class="form-input" name="supplier_name" placeholder="请输入运营商名称"  value="{$post.supplier_name}"/>
        </div>
        <div class="form-group">
            <label for="" >状态:</label>
            <select class="form-input" name="status" id="">
                <option value="" >全部</option>
                <option value="1" <if condition="$post['status'] eq 1">selected</if> >合作</option>
                <option value="-1" <if condition="$post['status'] eq -1">selected</if>>停止合作</option>
            </select>
        </div>
        <div class="form-group">
            <input class="btn btn-primary btn-sm" type="submit" value="查询"/>
        </div>


        <div class="col-xs-12"  style="margin-top:10px;">
            <!--  <button class="btn btn-primary btn-xs pull-right" style="margin-right: 10px">添加新的供应商</button>-->

            <if condition="checkAuth('Dealer/Shops/scenicExportExcel')">
                <a class="btn btn-primary btn-xs pull-right" style="margin-right: 10px" href="{:U('scenicExportExcel')}">导出</a>
            </if>


        </div>

    </form>

    <table class="table table-striped table-bordered table-hover table-condensed text-center">
        <thead>
        <tr>
            <th class="filtrate_1" >供应商编号 <!--<input type="checkbox" class="checkAll">--></th>
            <th class="filtrate_2" >供应商名称</th>
            <th class="filtrate_2" >所在地</th>
            <th class="filtrate_3" >项目</th>
            <th class="filtrate_4" >联系人</th>
            <th class="filtrate_5" >联系电话</th>
            <th class="filtrate_6" >状态</th>
            <th class="filtrate_6" >合作时间</th>
            <th class="filtrate_7"  style="width:220px">操作</th>
        </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
            <tr >
                <td class="filtrate_1" >{$vo.supplier_sn} <!--<input type="checkbox" class="chk">--></td>
                <td class="filtrate_2">{$vo.supplier_name}</td>
                <td class="filtrate_2">{$vo.addr}</td>
                <td class="filtrate_3">
                    <switch name="vo.type">
                        <case value="1">交通供应商</case>
                        <case value="2">酒店供应商</case>
                        <case value="3">保险供应商</case>
                        <case value="4">景区供应商</case>
                    </switch>
                </td>
                <td class="filtrate_4">{$vo.Linkman}</td>
                <td class="filtrate_5">{$vo.Linkman_phone}</td>
                <td class="filtrate_5">
                    <switch name="vo.status">
                        <case value="1">开通</case>
                        <case value="-1">锁定</case>
                     </switch>
                </td>
                <td class="filtrate_6">
                    {$vo.start_time|date='Y-m-d',###}至{$vo.end_time|date='Y-m-d',###}

                </td>
                <td class="filtrate_7">
                    <if condition="checkAuth('Dealer/Shops/addScenic')">
                        <a href="{:U('addScenic',array('supplier_id'=>$vo['supplier_id']))}" class="btn btn-xs btn-primary">新增</a>
                    </if>

                    <if condition="checkAuth('Dealer/Shops/scenicStatusById')">
                        <if condition="$vo['status'] eq 1">
                            <a href="{:U('scenicStatusById',array('id'=>$vo['supplier_id'],'status'=>-1))}" class="btn btn-xs btn-warning">锁定</a>
                            <else/>
                            <a href="{:U('scenicStatusById',array('id'=>$vo['supplier_id'],'status'=>1))}" class="btn btn-xs btn-primary">开通</a>
                        </if>
                    </if>
                    <if condition="checkAuth('Dealer/Shops/scenicProductById')">
                        <a href="{:U('scenicProductById',array('id'=>$vo['supplier_id']))}" class="btn btn-xs btn-primary">详情</a>
                    </if>

                    <if condition="checkAuth('Dealer/Shops/scenicPartnerRecord')">
                        <a href="{:U('scenicPartnerRecord',array('id'=>$vo['supplier_id']))}" class="btn btn-xs btn-primary">合作记录</a>
                    </if>

                </td>
            </tr>
        </volist>

        <tr>
            <td colspan="9">
                <!--分页样式-->
                <ul class="pagination">
                    {$show}
                </ul>
            </td>
        </tr>
        </tbody>
    </table>

</block>
<block name="js">
    <script src=""></script>
    <script src="__STATIC__/layui/layui.all.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script>
        /**
         * 打开订单详情页面
         * @param  {[int]}    orderId     [订单id]
         */

//筛选显示
        $('body').on('change','.filtrate',function () {
            var id=$(this).val();
            if($(this).is(':checked')){
                $('.filtrate_'+id).show();
            }else{
                $('.filtrate_'+id).hide();
            }
        });


        layui.use('laydate', function() {
            var laydate = layui.laydate;
            //常规用法
            laydate.render({
                elem: '#startDay'
            });
            laydate.render({
                elem: '#endDay'
            });
            laydate.render({
                elem: '#tourDay'
            });
            laydate.render({
                elem: '#groupDay'
            });
        })

        /**
         *订单详情
         * @param orderId
         */

        function openDetail(orderId){
            layer.open({
                type: 2,
                offset:20,
                area: ['90%','90%'],
                title: '订单详情',
                content: '{:U("Orders/detail")}',
            })
        }
    </script>
</block>
